[Webkit-unassigned] [Bug 190140] New: Incorrect "name" property set for class expression without BindingIdentifier

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 1 09:31:57 PDT 2018


            Bug ID: 190140
           Summary: Incorrect "name" property set for class expression
                    without BindingIdentifier
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: gsouza at salesforce.com

The "name" property in the constructor function for an anonymous class expression is incorrectly set to an empty string in JavaScriptCore:

// Webkit/JavaScriptCore
(class {}).hasOwnProperty('name') // true
(class extends (class A{}){}).hasOwnProperty('name') // true
(class extends(class A{}){}).name // ''

// Other spec-compliant JS engines
(class {}).hasOwnProperty('name') // false
(class extends (class A{}){}).hasOwnProperty('name') // false
(class extends(class A{}){}).name // 'A'

The ES6 spec states that SetFunctionName(value, className) should only be called when className is not undefined, which isn't the case for anonymous class expressions: http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions-runtime-semantics-evaluation

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/20181001/84c2fb0d/attachment.html>

More information about the webkit-unassigned mailing list