[Webkit-unassigned] [Bug 219841] New: NewExpression : new MemberExpression : new SuperProperty throws early SyntaxError

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 13 15:15:17 PST 2020


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

            Bug ID: 219841
           Summary: NewExpression : new MemberExpression : new
                    SuperProperty throws early SyntaxError
           Product: WebKit
           Version: Safari 14
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: valentinium at gmail.com

(See similar, but not identical, V8 issue: https://bugs.chromium.org/p/v8/issues/detail?id=11261)

What steps will reproduce the problem?

```
let obj = ({ __proto__: { x: class {} }, y() { return new super.x; } });
```

What is the expected output?

A normal completion whose value is a new object.

What do you see instead?

An early SyntaxError is thrown.

Notes

This is a valid NewExpression. SpiderMonkey exhibits the expected behavior. V8 doesn’t, but instead of an early SyntaxError, it throws a ReferenceError only if `obj.y()` is called.

This is not specific to object literals or absent parentheses. The same behavior  can be observed using class syntax to establish the HomeObject, e.g.

```
class Sup { static SupProperty = class {} }
class Sub extends Sup { static SubProperty() { return new super.supProperty(); } }
Sub.subProperty();
```

-- 
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/20201213/5ac34b6a/attachment-0001.htm>


More information about the webkit-unassigned mailing list