-
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
_intrinsics_.[[%Foo.bar%]]
isn't defined
#2538
Comments
For those two intrinsics (since it's rare to access things directly off of |
So reinstate |
That seems like the shortest-term solution, albeit a bit of a gross one. |
On second thought, this is just part of a larger problem. By combining statements from 6.1.7.4 Well-Known Intrinsic Objects and 9.3.2 CreateIntrinsics, we can infer that However, there's no corresponding shorthand for Now, it's true that there are other cases where the spec specifies some semantics without giving an explicit structure (e.g., the properties of an object, the bindings in an environment record), and we could say that So I think we should keep the |
That would be unsustainable, since every single thing in the spec is an intrinsic. The whole benefit of the intrinsics syntax is its implicitness. |
I'm not suggesting changing the intrinsics syntax. |
Right - I’m saying that explicitly adding every intrinsic to [[Intrinsics]] is unsustainable. |
I'm also not suggesting explicitly adding anything to [[Intrinsics]]. Step 3 of CreateIntrinsics would retain its current implicitness. |
I suppose that'd be workable. |
(Sorry, that was my fault. Since my first comment suggested explicitly adding |
Sounds good to the editors, and in particular we think that the logic probably belongs in step 3 of CreateIntrinsics, but we'd need to come up with some wording. |
That step is already the longest one in the whole spec (by a wide margin), so I'm reluctant to make it much longer. (One possibility: we could make that step a Host operation unto itself. All the sentences of the step could become constraints that the operation must conform to, which I think would allow them to be formatted more readably.)
I think we'd benefit from defining 'intrinsics'. The intuition is that the intrinsics are exactly the set of objects created by step 3, but of course we have to define it the other way around. Something like:
At (b), I was tempted to also recurse on the value of internal slots, in particular We should maybe note that an implementation is allowed to add its own things to (a). Then step 3 has two parts:
Mind you, the concept of the "spec-internal name" of an intrinsic is theoretically under-defined. E.g.:
Of course, the spec doesn't ever refer to that intrinsic explicitly, so to that extent the answer doesn't matter. Some possible answers:
|
I just realized that references of the form
_intrinsics_.[[%Foo.bar%]]
aren't defined.9.3.2 CreateIntrinsics says of the intrinsics Record:
and that includes
%Foo%
, but not%Foo.bar%
. (That table dropped its rows for 'subordinate' intrinsics in PR #2056, but even before that,%Foo.bar%
only appeared in column 3; column 1 had the old-style%FooBar%
.)I think there are only three cases of this:
_intrinsics_.[[%Function.prototype%]]
inCreateIntrinsics
_intrinsics_.[[%Object.prototype%]]
inSetRealmGlobalObject
_realm_.[[Intrinsics]].[[%Function.prototype%]]
inCreateBuiltinFunction
It's not obvious to me how to fix these. E.g.:
_intrinsics_.[[%Foo%]].bar
is improper pseudo-syntax.GetV(_intrinsics_.[[%Foo%]], "bar")
is well defined, but it doesn't work, because it returns the current value of the 'bar' property, whereas%Foo.bar%
is defined to be the initial value ("prior to any ECMAScript code being evaluated"). This doesn't make a difference for the first two cases, becauseCreateIntrinsics
andSetRealmGlobalObject
only execute before user code, but it's a problem for the third case, becauseCreateBuiltinFunction
sometimes executes after user code.Maybe we need to just say that the intrinsics Record also has fields for
%Function.prototype%
and%Object.prototype%
.The text was updated successfully, but these errors were encountered: