archives

« Bugzilla Issues Index

#3967 — 18.2.1.2 EvalDeclarationInstantiation: WebCompat and lexical redeclaration checks in with/catch blocks


18.2.1.2 Runtime Semantics: EvalDeclarationInstantiation( body, varEnv, lexEnv, strict)

EvalDeclarationInstantiation should probably skip object environment records, because object env records can hold arbitrary bindings. Currently they're processed:
---
js> function f() { with({a: 0}) eval("var a = 1") } f()
uncaught exception: SyntaxError: redeclaration of variable: "a"
---

I'm not sure if it is necessary for web-compat to special case catch blocks when checking for lexical redeclarations. Currently:
---
js> function f() { try {throw null} catch (e){ eval("var e = 0") } } f()
uncaught exception: SyntaxError: redeclaration of variable: "e"
---

"B.3.5 VariableStatements in Catch blocks" explicitly allows this form, does EvalDeclarationInstantiation need a similar extension?
---
js> function f() { try {throw null} catch (e){ var e = 0 } } f()
---


fixed in rev34 editor's draft

including additions to B.3.5


fixed in rev34