Bug 156146

Summary: When assigning to a sloppy mode hoisting candidate we should bind both its local binding and its 'var' binding
Product: WebKit Reporter: Saam Barati <saam>
Component: JavaScriptCoreAssignee: Saam Barati <saam>
Status: RESOLVED INVALID    
Severity: Normal CC: benjamin, fpizlo, ggaren, gskachkov, keith_miller, mark.lam, msaboff, oliver, sukolsak, ysuzuki
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Saam Barati
Reported 2016-04-03 11:20:26 PDT
For example, this should work: function foo() { assert(f === undefined); { assert(typeof f === "function") f = 42 assert(f === 42); function f() { } } assert(f === 42); } We can't do this solely inside the bytecode generator. This requires some runtime support for the annoying dynamic cases, i.e: function foo() { assert(f === undefined); { function f() { } with ({}) { assert(typeof f === "function") f = 42 assert(f === 42); } } assert(f === 42); }
Attachments
Note You need to log in before you can comment on or make changes to this bug.