Two tests in this suite assert opposite results for the identical shape, and no engine can pass both.
// annexB/language/function-code/block-decl-func-skip-arguments.js (2017)
(function() {
{ function arguments() {} }
assert.sameValue(arguments.toString(), "[object Arguments]"); // expects the arguments object
}());
// staging/sm/lexical-environment/block-scoped-functions-annex-b-arguments.js
(function() {
{ function arguments() {} }
assert.sameValue(typeof arguments, "function"); // expects the function
}());
The annexB file is the stale one: its info block quotes "22.f. Append "arguments" to parameterNames", a step the current FunctionDeclarationInstantiation no longer has. Today paramBindings is "the list-concatenation of paramNames and « "arguments" »" (step 22.h) while the web-compat eligibility test consults paramNames, which does not carry the implicit arguments. A block-level function arguments(){} is therefore eligible; the funcName is not \"arguments\" guard skips only the creation of a new var binding, and the funcEnv.SetMutableBinding(funcName, funcObj, false) performed when the declaration is evaluated still runs.
V8 (node 24.19.0) and SpiderMonkey both answer "function", i.e. both fail the annexB file and pass the staging one.
#5112 updates the annexB file to the current algorithm and adds a case for a formal parameter really named arguments (which is in paramNames, so its declaration is not eligible) — the distinction currently has no coverage.
Found while enabling staging/ in Jint (sebastienros/jint#3021).
Two tests in this suite assert opposite results for the identical shape, and no engine can pass both.
The annexB file is the stale one: its
infoblock quotes "22.f. Append "arguments" to parameterNames", a step the current FunctionDeclarationInstantiation no longer has. TodayparamBindingsis "the list-concatenation of paramNames and « "arguments" »" (step 22.h) while the web-compat eligibility test consultsparamNames, which does not carry the implicitarguments. A block-levelfunction arguments(){}is therefore eligible; thefuncName is not \"arguments\"guard skips only the creation of a new var binding, and thefuncEnv.SetMutableBinding(funcName, funcObj, false)performed when the declaration is evaluated still runs.V8 (node 24.19.0) and SpiderMonkey both answer
"function", i.e. both fail the annexB file and pass the staging one.#5112 updates the annexB file to the current algorithm and adds a case for a formal parameter really named
arguments(which is inparamNames, so its declaration is not eligible) — the distinction currently has no coverage.Found while enabling
staging/in Jint (sebastienros/jint#3021).