NEW 190140
Incorrect "name" property set for class expression without BindingIdentifier
https://bugs.webkit.org/show_bug.cgi?id=190140
Summary Incorrect "name" property set for class expression without BindingIdentifier
gsouza
Reported 2018-10-01 09:31:57 PDT
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
Attachments
Note You need to log in before you can comment on or make changes to this bug.