[Webkit-unassigned] [Bug 205578] New: Not using strict mode within ClassDeclaration statement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 24 01:16:05 PST 2019


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

            Bug ID: 205578
           Summary: Not using strict mode within ClassDeclaration
                    statement
           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: sunlili at ict.ac.cn

The bug can be reproduced in latest jsc version.
code:

class c extends(d = function() {
    return 0;
}, d) {};

JSC print nothing, however, it should throw an error.

According to ecma-262
• All parts of a ClassDeclaration or a ClassExpression are strict mode code.
• In strict mode code, assignment to an undeclared identifier or otherwise unresolvable reference does not create a property in the global object. When a simple assignment occurs within strict mode code, its LeftHandSideExpression must not evaluate to an unresolvable Reference. If it does, a ReferenceError exception is thrown.
So, assignment to ‘d’, which is undeclared, should throw a ReferenceError exception.

ISec Lab
2019.12.24

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191224/01ca1a5a/attachment-0001.htm>


More information about the webkit-unassigned mailing list