Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for NewExpression -> new MemberExpression -> new SuperProperty #2920

Open
bathos opened this issue Dec 13, 2020 · 1 comment
Open

Test for NewExpression -> new MemberExpression -> new SuperProperty #2920

bathos opened this issue Dec 13, 2020 · 1 comment

Comments

@bathos
Copy link

bathos commented Dec 13, 2020

Currently, V8 exhibits different behavior from JSC and SpiderMonkey for this construction.

When I first wrote this, I reported that JSC exhibited a third behavior (early SyntaxError). However this appears to be fixed in JSC as of 14.1 TP, making V8 the outlier.

In V8, a runtime ReferenceError is thrown when the expression is evaluated (chromium issue).
In JSC and SpiderMonkey, no error is thrown and behavior is, as far as I’m aware, correct.

Examples:

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

class X { static get x() { return class {} } }
class Y extends X { static y() { return new super.x() } }
Y.y(); // ReferenceError thrown

I cloned Test262 and started poking around to see if maybe I could author a coherent test, but I figured I should open an issue first to confirm that the SpiderMonkey/JSC behavior is the correct one.

@leobalter
Copy link
Member

leobalter commented Dec 14, 2020

It seems like a valid case. I'd need to run through the tests to find something but I believe the search will be challenging for the object methods.

One way to potentially find equivalent tests would be searching for failures in V8 runs for the class and objects tests. Although, I'm not finding anything like it so far.

E.g.

Note that you would need to avoid the __proto__ due to annex b being separated, but that's not a blocker for the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants