Skip to content
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

Why does the text in the note in 14.9.1 refer to 9.2.4? #1848

Closed
dSalieri opened this issue Jan 20, 2020 · 11 comments
Closed

Why does the text in the note in 14.9.1 refer to 9.2.4? #1848

dSalieri opened this issue Jan 20, 2020 · 11 comments
Labels

Comments

@dSalieri
Copy link

In 14.9.1 Static Semantics: IsInTailPosition (call) there is a note that says:

Tail Position calls are only defined in strict mode code because of a common non-standard language extension (see 9.2.4) that enables observation of the chain of caller contexts.

Why does the note refer to 9.2.4 (in 9.2.4 a common non-standard language extension is not described)? 9.2.4 describes an abstract operation that creates 2 properties for Function.prototype of an object which, when called, should throw an error. Thereby preventing observation of the chain of caller contexts.

In more detail: I wanted to say that the reference to 9.2.4 somehow seems to be out of place in the note (by my opinion). If you do not follow this link (9.2.4), you might think that it describes a common non-standard language extension, its rules or something like that - but it is not. Is it possible to paraphrase this note somehow?

How can you comment on this situation?

@ljharb
Copy link
Member

ljharb commented Jan 20, 2020

https://tc39.es/ecma262/#sec-addrestrictedfunctionproperties describes a function's caller and arguments properties, which are indeed common non-standard language extensions; additionaly, if you look at the 2015 snapshot you'll see that it links to 9.2.7, which is the same section that 9.2.4 now refers to.

@dSalieri
Copy link
Author

dSalieri commented Jan 20, 2020

@ljharb wait a minute but they (property names: "caller", "arguments") are described by the specification here (in 9.2.4). Why do you say that they are not described by the specification? And then what does 9.2.4 mean for the specification? Or what did I miss? Yes, I saw a snapshot of 2015 - everything is identical there.

@ljharb
Copy link
Member

ljharb commented Jan 20, 2020

The spec has them as restricted; i believe prior to having that, the properties may have been nonstandard (as in, not in the spec, and only supplied by browsers)

@claudepache
Copy link
Contributor

claudepache commented Jan 20, 2020

The problem is that there is no good place to link, because the spec currently avoids to name explicitly the incriminated well-known “non-standard language extension” like dirty words. Hopefully, the issue will be resolved the same day as #562.

@dSalieri
Copy link
Author

dSalieri commented Jan 20, 2020

@ljharb

The spec has them as restricted;

probably you wanted to write restriction instead of restricted? Because it makes a lot of sense.
If my amendment is out of place then what does your sentence mean?

In other words, the "caller" and "arguments" properties are not defined by the specification, but they have a number of restrictions described in the specification, and the abstract operation (9.2.4) also adjoins these restrictions. Right? But the question remains the same: why does the text in note 14.9.1 refer to 9.2.4 if 9.2.4 is a standardized abstract operation by specification?


@claudepache hmm, and that sounds pretty convincing. Although it’s strange for me personally, you can somehow formulate it so that it doesn’t sound like dirty words. And then this is a browser issue, not a specification. They continue to use from year to year that which has never been officially specified in the specification (excluding restrictions imposed by the specification). In any case, if my issue is solved on the same day as yours, this will be wonderful.

@ljharb
Copy link
Member

ljharb commented Jan 21, 2020

@dSalieri no, i meant to write "restricted", the adjective form; "restriction" is the noun form. The spec has them as restricted; the spec also has them as restrictions - both phrases are correct and mean effectively the same thing.

@dSalieri
Copy link
Author

@ljharb in my language, this makes a big difference to the meaning. But I understand you. By the way, you didn’t react at all to the second paragraph. I would like to see your comment on this.

@ljharb
Copy link
Member

ljharb commented Jan 21, 2020

If the properties exist and accessing them doesn't throw, they're non-standard. That non-standard extension is the reason the restrictions were added in the first place.

@dSalieri
Copy link
Author

dSalieri commented Jan 21, 2020

@ljharb yeah understood, then 9.2.4 is a restrictions for properties "caller" and "arguments". Right?

@ljharb
Copy link
Member

ljharb commented Jan 21, 2020

Yes, that’s my understanding.

@dSalieri
Copy link
Author

@ljharb thank you for your responses

@ljharb ljharb closed this as completed Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants