-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spec fixes, applies review feedback #309
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,15 +93,16 @@ <h1>[[Call]] ( _thisArgument_, _argumentsList_ )</h1> | |
1. Assert: IsCallable(_target_) is *true*. | ||
1. Let _targetRealm_ be ? GetFunctionRealm(_target_). | ||
1. Let _callerRealm_ be ? GetFunctionRealm(_F_). | ||
1. For each element _key_ of _argumentsList_, do | ||
1. Let _o_ be _argumentsList_[_key_]. | ||
1. Set _argumentsList_[_key_] to ? GetWrappedValue(_targetRealm_, _o_). | ||
1. Let _wrappedArgs_ be a new empty List. | ||
1. For each element _arg_ of _argumentsList_, do | ||
1. Let _wrappedValue_ be ? GetWrappedValue(_targetRealm_, _arg_). | ||
1. Append _wrappedValue_ to _wrappedArgs_. | ||
1. Let _wrappedThisArgument_ to ? GetWrappedValue(_targetRealm_, _thisArgument_). | ||
1. Let _result_ be the Completion Record of Call(_target_, _wrappedThisArgument_, _argumentsList_). | ||
1. Let _result_ be the Completion Record of Call(_target_, _wrappedThisArgument_, _wrappedArgs_). | ||
1. If _result_.[[Type]] is ~normal~ or _result_.[[Type]] is ~return~, then | ||
1. Return ? GetWrappedValue(_callerRealm_, _result_). | ||
1. Else, | ||
1. Throw a newly created TypeError object associated to the _callerRealm_. | ||
1. Throw a newly created TypeError object associated with the _callerRealm_. | ||
</emu-alg> | ||
<emu-note type=editor> | ||
In the case of an abrupt ~throw~ completion, the type of error to be created should match the type of the abrupt throw completion record. This could be revisited when merging into the main specification. Additionally, in the case of a ~break~ or ~continue~ completion, since those are not supported, a TypeError is expected. | ||
|
@@ -136,17 +137,14 @@ <h1>PerformRealmEval ( _sourceText_, _callerRealm_, _evalRealm_ )</h1> | |
1. Assert: _callerRealm_ is a Realm Record. | ||
1. Assert: _evalRealm_ is a Realm Record. | ||
1. Perform ? HostEnsureCanCompileStrings(_callerRealm_, _evalRealm_). | ||
1. Let _inFunction_ be *false*. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this form was copied from https://tc39.es/ecma262/#sec-performeval. My bad, because the flag for direct eval is not longer needed, therefore these lets declarations are not needed anymore. Good catch! |
||
1. Let _inMethod_ be *false*. | ||
1. Let _inDerivedConstructor_ be *false*. | ||
1. Perform the following substeps in an implementation-defined order, possibly interleaving parsing and error detection: | ||
1. Let _script_ be ParseText(! StringToCodePoints(_sourceText_), |Script|). | ||
1. If _script_ is a List of errors, throw a *SyntaxError* exception. | ||
1. If _script_ Contains |ScriptBody| is *false*, return *undefined*. | ||
1. Let _body_ be the |ScriptBody| of _script_. | ||
1. If _inFunction_ is *false*, and _body_ Contains |NewTarget|, throw a *SyntaxError* exception. | ||
1. If _inMethod_ is *false*, and _body_ Contains |SuperProperty|, throw a *SyntaxError* exception. | ||
1. If _inDerivedConstructor_ is *false*, and _body_ Contains |SuperCall|, throw a *SyntaxError* exception. | ||
1. If _body_ Contains |NewTarget| is *true*, throw a *SyntaxError* exception. | ||
1. If _body_ Contains |SuperProperty| is *true*, throw a *SyntaxError* exception. | ||
1. If _body_ Contains |SuperCall| is *true*, throw a *SyntaxError* exception. | ||
1. Let _strictEval_ be IsStrict of _script_. | ||
1. Let _runningContext_ be the running execution context. | ||
1. Let _lexEnv_ be NewDeclarativeEnvironment(_evalRealm_.[[GlobalEnv]]). | ||
|
@@ -223,7 +221,7 @@ <h1>The Realm Constructor</h1> | |
|
||
<emu-clause id="sec-realm"> | ||
<h1>Realm ()</h1> | ||
<p>When the `Realm` function is called with no arguments, the following steps are taken:</p> | ||
<p>When the `Realm` function is called, the following steps are taken:</p> | ||
<emu-alg> | ||
1. If NewTarget is *undefined*, throw a *TypeError* exception. | ||
1. Let _O_ be ? OrdinaryCreateFromConstructor(NewTarget, "%Realm.prototype%", « [[Realm]], [[ExecutionContext]] »). | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was me being lazy! jajaja... good catch!