-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Editorial: stop using strings for special values #2155
Conversation
This was extracted from tc39#2154 so it could land separately.
This was extracted from tc39#2154 so it could land separately.
This was extracted from tc39#2154 so it could land separately.
This was extracted from tc39#2154 so it could land separately. Co-authored-by: Jordan Harband <ljharb@gmail.com>
This was extracted from tc39#2154 so it could land separately. Co-authored-by: Jordan Harband <ljharb@gmail.com>
This was extracted from tc39#2154 so it could land separately. Co-authored-by: Jordan Harband <ljharb@gmail.com>
This was extracted from tc39#2154 so it could land separately. Co-authored-by: Jordan Harband <ljharb@gmail.com>
This was extracted from tc39#2154 so it could land separately. Co-authored-by: Jordan Harband <ljharb@gmail.com>
There's another special string: |
spec.html
Outdated
@@ -23816,7 +23816,7 @@ <h1>InitializeEnvironment ( ) Concrete Method</h1> | |||
1. Let _module_ be this Source Text Module Record. | |||
1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do | |||
1. Let _resolution_ be ? _module_.ResolveExport(_e_.[[ExportName]]). | |||
1. If _resolution_ is *null* or *"ambiguous"*, throw a *SyntaxError* exception. | |||
1. If _resolution_ is *null* or ~ambiguous~ throw a *SyntaxError* exception. |
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.
1. If _resolution_ is *null* or ~ambiguous~ throw a *SyntaxError* exception. | |
1. If _resolution_ is *null* or ~ambiguous~, throw a *SyntaxError* exception. |
spec.html
Outdated
@@ -12165,7 +12165,7 @@ <h1>Runtime Semantics: BindingInitialization</h1> | |||
<h1>Runtime Semantics: InitializeBoundName ( _name_, _value_, _environment_ )</h1> | |||
<p>The abstract operation InitializeBoundName takes arguments _name_, _value_, and _environment_. It performs the following steps when called:</p> | |||
<emu-alg> | |||
1. Assert: Type(_name_) is String. | |||
1. Assert: Either Type(_name_) is String, or _name_ is ~default~. | |||
1. If _environment_ is not *undefined*, then | |||
1. Perform _environment_.InitializeBinding(_name_, _value_). |
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.
I am pretty sure we shouldn't actually be attempting to initialize a binding named ~default~
.
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.
fixed in 870e5f7
This was extracted from tc39#2154 so it could land separately. Co-authored-by: Jordan Harband <ljharb@gmail.com>
Handled the ImportEntry Records string in 158950a. |
@@ -24636,7 +24635,7 @@ <h1>Runtime Semantics: Evaluation</h1> | |||
<emu-alg> | |||
1. Let _value_ be ? BindingClassDeclarationEvaluation of |ClassDeclaration|. | |||
1. Let _className_ be the sole element of BoundNames of |ClassDeclaration|. | |||
1. If _className_ is *"\*default\*"*, then | |||
1. If _className_ is ~default~, then |
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.
I don't actually understand why we're making/initializing a binding here at all. Possibly some interaction with module instantiation I'm missing? Anyone know what's up with that?
@@ -20352,10 +20351,10 @@ <h1>Static Semantics: BoundNames</h1> | |||
</emu-alg> | |||
<emu-grammar>GeneratorDeclaration : `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}`</emu-grammar> | |||
<emu-alg> | |||
1. Return « *"\*default\*"* ». | |||
1. Return « ~default~ ». |
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.
I believe this still ends up making a binding named ~default~
in InitializeEnvironment of Source Text Module Records, step 23.
…tcampbell The "Arbitrary module namespace identifier names" spec PR allows to use "*" as a module export name, so we can no longer use that specific string to denote star-imports/exports. Probably the easiest way to work around this new restriction is to replace "*" with a nullptr string. Spec change: tc39/ecma262#2155 Differential Revision: https://phabricator.services.mozilla.com/D101013
…tcampbell The "Arbitrary module namespace identifier names" spec PR allows to use "*" as a module export name, so we can no longer use that specific string to denote star-imports/exports. Probably the easiest way to work around this new restriction is to replace "*" with a nullptr string. Spec change: tc39/ecma262#2155 Differential Revision: https://phabricator.services.mozilla.com/D101013
3d0c24c
to
7a79833
Compare
</td> | ||
<td> | ||
The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. *null* if the |ExportDeclaration| does not have a |ModuleSpecifier|. *"\*"* indicates that the export request is for all exported bindings. | ||
The name under which the desired binding is exported by the module identified by [[ModuleRequest]]. *null* if the |ExportDeclaration| does not have a |ModuleSpecifier|. ~*~ indicates that the export request is for all exported bindings. |
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.
I would prefer to use something like ~all~
for this.
This was extracted from #2154 so it could land separately.