[Webkit-unassigned] [Bug 167328] New: strict mode eval doesn't initialize functions with the proper scope

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 23 15:10:12 PST 2017


https://bugs.webkit.org/show_bug.cgi?id=167328

            Bug ID: 167328
           Summary: strict mode eval doesn't initialize functions with the
                    proper scope
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sbarati at apple.com
                CC: benjamin at webkit.org, fpizlo at apple.com,
                    ggaren at apple.com, gskachkov at gmail.com,
                    jfbastien at apple.com, keith_miller at apple.com,
                    mark.lam at apple.com, msaboff at apple.com,
                    oliver at apple.com, ticaiolima at gmail.com,
                    utatane.tea at gmail.com

They don't have access to the eval's lexical variables at the top level. For example, this doesn't work:
eval("'use strict'; let x = 20; function foo() { return x; }; foo();")

But these do:
eval("'use strict'; let x = 20; let foo = function() { return x; }; foo();")
eval("'use strict'; let x = 20; let y; { function foo() { return x; }; y =foo;} y();")

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170123/255043fa/attachment.html>


More information about the webkit-unassigned mailing list