Failure summary
6 tests fail (3 files × strict + non-strict), all in test262/test/language/global-code/:
script-decl-var-err.js — var declaration on non-extensible global
script-decl-func-err-non-extensible.js — function declaration on non-extensible global
script-decl-func-err-non-configurable.js — function declaration when property is non-configurable
All fail with: Expected a TypeError to be thrown but no exception was thrown at all
Reproduction
make test262-filter FILTER=language/global-code/script-decl-var-err
make test262-filter FILTER=language/global-code/script-decl-func-err
Spec
ES2024 section 15.1.11 GlobalDeclarationInstantiation:
- Step 9 (for functions): calls
CanDeclareGlobalFunction(fn), throws TypeError if false
- Step 12 (for vars): calls
CanDeclareGlobalVar(vn), throws TypeError if false
Section 9.1.1.4.15 CanDeclareGlobalVar returns false when the global has no matching own property AND IsExtensible(globalObject) is false.
Section 9.1.1.4.16 CanDeclareGlobalFunction returns false when the property does not exist and global is non-extensible, OR when the property is non-configurable and non-writable/non-enumerable.
The engine silently allows the declaration instead of throwing.
Source files
GlobalDeclarationInstantiation likely lives in the interpreter's module/script evaluation path. The CanDeclareGlobalVar/CanDeclareGlobalFunction predicates need to be checked and their false-return paths need to throw TypeError.
Failure summary
6 tests fail (3 files × strict + non-strict), all in
test262/test/language/global-code/:script-decl-var-err.js— var declaration on non-extensible globalscript-decl-func-err-non-extensible.js— function declaration on non-extensible globalscript-decl-func-err-non-configurable.js— function declaration when property is non-configurableAll fail with:
Expected a TypeError to be thrown but no exception was thrown at allReproduction
Spec
ES2024 section 15.1.11 GlobalDeclarationInstantiation:
CanDeclareGlobalFunction(fn), throws TypeError if falseCanDeclareGlobalVar(vn), throws TypeError if falseSection 9.1.1.4.15 CanDeclareGlobalVar returns false when the global has no matching own property AND
IsExtensible(globalObject)is false.Section 9.1.1.4.16 CanDeclareGlobalFunction returns false when the property does not exist and global is non-extensible, OR when the property is non-configurable and non-writable/non-enumerable.
The engine silently allows the declaration instead of throwing.
Source files
GlobalDeclarationInstantiationlikely lives in the interpreter's module/script evaluation path. TheCanDeclareGlobalVar/CanDeclareGlobalFunctionpredicates need to be checked and their false-return paths need to throw TypeError.