test262 icon indicating copy to clipboard operation
test262 copied to clipboard

Class instance property initializers + CreateDataPropertyOrThrow + computed property names

Open bathos opened this issue 3 years ago • 1 comments

In V8 there are scenarios where it becomes observable that CreateDataPropertyOrThrow semantics are not really being used for instance field initializers. I've opened a Chromium issue.

Though the demonstration code uses return override, I suspect the issue can be illustrated just as readily by defining properties on this within initializer expressions themselves.

The attachment is not a proper test suite of the sort suitable for test262, but seeing which cases presently fail may still be instructive. All of the tests there succeed in Spidermonkey.

screenshot of console output for v8 with summaries of cases that did not exhibit the correct semantics. the code in the attachment linked above will give you the whole thing

bathos avatar Mar 03 '22 05:03 bathos

The issue here is narrower than I’d realized: per @joyeecheung, these failure cases occur only when using computed property syntax, and a minimal example demonstrating this was given in the Chromium bug thread:

class X {
 static ['name'] = "name"
}

bathos avatar Mar 11 '22 21:03 bathos