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: |
| 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.
| 1. If _resolution_ is *null* or ~ambiguous~ throw a *SyntaxError* exception. | |
| 1. If _resolution_ is *null* or ~ambiguous~, throw a *SyntaxError* exception. |
| 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.
I am pretty sure we shouldn't actually be attempting to initialize a binding named ~default~.
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. |
| 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.
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?
| <emu-grammar>GeneratorDeclaration : `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}`</emu-grammar> | ||
| <emu-alg> | ||
| 1. Return « *"\*default\*"* ». | ||
| 1. Return « ~default~ ». |
There was a problem hiding this comment.
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.
I would prefer to use something like ~all~ for this.
…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

This was extracted from #2154 so it could land separately.