Skip to content

Instantly share code, notes, and snippets.

@leobalter
Last active January 7, 2020 17:46
Show Gist options
  • Save leobalter/17ba75d682094fb028f6a6e05f82f501 to your computer and use it in GitHub Desktop.
Save leobalter/17ba75d682094fb028f6a6e05f82f501 to your computer and use it in GitHub Desktop.

Current

SuperCall : super Arguments

1. Let newTarget be GetNewTarget().
2. Assert: Type(newTarget) is Object.
3. Let func be ? GetSuperConstructor().
4. Let argList be ? ArgumentListEvaluation of Arguments.
5. Let result be ? Construct(func, argList, newTarget).
6. Let thisER be GetThisEnvironment().
7. Return ? thisER.BindThisValue(result). 

Possibly proposed in the PR

SuperCall : super Arguments

1. Let newTarget be GetNewTarget().
2. Assert: Type(newTarget) is Object.
3. Let func be GetSuperConstructor().
4. Let argList be ? ArgumentListEvaluation of Arguments.
5. ReturnIfAbrupt(func).
6. Let result be ? Construct(func, argList, newTarget).
7. Let thisER be GetThisEnvironment().
8. Return ? thisER.BindThisValue(result). 

Suggestion

SuperCall : super Arguments

1. Let newTarget be GetNewTarget().
2. Assert: Type(newTarget) is Object.
3. Let argList be ? ArgumentListEvaluation of Arguments.
4. Let func be ? GetSuperConstructor().
5. Let result be ? Construct(func, argList, newTarget).
6. Let thisER be GetThisEnvironment().
7. Return ? thisER.BindThisValue(result). 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment